package com.xbkj.pgrp.server.model.app;

import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.jpa.model.BaseModel;
import xyz.erupt.upms.model.base.HyperModel;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.Date;

/**
 * 项目里程碑信息
 */
@Erupt(
        name = "项目里程碑信息",
        orderBy = "msDate desc"
)
@Entity
@Table(name = "pgrp_milestone")
@Getter
@Setter
public class MileStone extends HyperModel {

    /**
     * 里程碑信息
     */
    @EruptField(
            views = @View(title = "里程碑信息"),
            edit = @Edit(title = "里程碑信息", notNull = true)
    )
    private String  milestone;

    /**
     * 里程碑时间节点
     */
    @EruptField(
            views = @View(title = "里程碑时间节点"),
            edit = @Edit(title = "里程碑时间节点", notNull = true)
    )
    @Column(columnDefinition = "datetime", nullable = false)
    private Date msDate;

    /**
     * 状态
     */
    @EruptField(
            views = @View(title = "状态"),
            edit = @Edit(title = "状态", notNull = true)
    )
    private String msStatus;

    /**
     * 描述
     */
    @EruptField(
            views = @View(title = "描述"),
            edit = @Edit(title = "描述", type = EditType.TEXTAREA)
    )
    @Column(length = 1024)
    private String  memo;

    @ManyToOne
    private Project project;
}
